﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using LightWeb.DomainModel.Security;
using System.Diagnostics;

namespace LightWeb.DomainModel.Tests
{
    [TestFixture]
    public class SecurityFixture : FixtureBase
    {
        [Test]
        public void CreateRole()
        {
            Service service = new Service();
            service.CreateRole("Admin");
        }
        [Test]
        public void IsRoleExists()
        {
            Service service = new Service();
            service.RoleExists("Admin");
        }

        [Test]
        public void OutputRoles()
        {
            Service service = new Service();
            var list = service.GetAllRoles();
            Debug.WriteLine("Total {0} roles", list.Count);
            foreach (var item in list)
            {
                Debug.WriteLine(item.Name);
                service.DeleteRole(item.Name, true);
            }
        }

        [Test]
        public void DeleteRole()
        {
            Service service = new Service();
            service.DeleteRole("Admin", true);
        }
    }
}
